
from whiff import resolver
from whiff import whiffenv
import cgiRewrite

"""
def __wsgi__(env, start_response):
    path_remainder = env[whiffenv.PATH_REMAINDER]
    operation = path_remainder[0]
    remainder = path_remainder[1:]
    parameterName = "parameter"
    # modify the cgi dictionary to include the user, date and title parameters
    env = resolver.process_cgi(env, parse_cgi=True)
    cgi_dict = env[whiffenv.CGI_DICTIONARY].copy()
    cgi_dict[parameterName] = [operation]
    env[whiffenv.CGI_DICTIONARY] = cgi_dict
    # delegate the response to blog_root/OPERATION
    url = "_ChildTemplate/" + "/".join(remainder)
    return resolver.callUrl(url, env, start_response)
"""
__wsgi__ = cgiRewrite.__middleware__("parameter")

__wsgi_directory__ = True

resolver.publish_templates(__path__[0], globals())
